---
title: "R11.CdP_Year"
---

# Load Packages
```{r}
library(tidyverse)
library(sandwich)
library(stargazer)
```

# Load Data
```{r}
load("Data/data_final.Rdata")
```

# Remove Missing Districts
```{r}
# Missing: 7. Evora, 14. Santarem
data_sample <- data_final %>% filter(!(DistN %in% c(7, 14)))
```

# Run Models (App. Table 3ciii)
```{r}

m.1 <- lm(resid ~ cdp_year, data = data_sample)
m.2 <- lm(resid ~ cdp_year + ln_Confs_All, data = data_sample)
m.3 <- lm(resid ~ cdp_year + ln_Confs_All + as.factor(MFULL), data = data_sample)

# Robust standard errors
s.1 <- sqrt(diag(vcovHC(m.1, type = "HC1")))
s.2 <- sqrt(diag(vcovHC(m.2, type = "HC1")))
s.3 <- sqrt(diag(vcovHC(m.3, type = "HC1")))

stargazer(m.1, m.2, m.3, 
          type = "text",
          se = list(s.1, s.2, s.3), 
          keep = c("cdp_year", "ln_Confs_All"), 
          covariate.labels = c("Casa do Povo Year", "Log(Social Conflicts, 1947-1962)"), 
          dep.var.labels = "Mismatch Index")

```

